package org.bizming.passport.service;

import java.util.List;

import org.bizming.base.BaseException;
import org.bizming.passport.model.Passport;

public interface PassportService {

	/**
	 * 用户注册
	 * 
	 * @param user
	 * @return 主键
	 */
	public boolean add(Passport passport) throws BaseException;

	/**
	 * 用户登录
	 * 
	 * @param username
	 * @param pwd
	 * @return
	 * @throws BaseException
	 */
	public boolean auth(String username, String pwd) throws BaseException;

	/**
	 * 根据用户名获取用户信息
	 * 
	 * @param username
	 * @return
	 */
	public Passport getByUsername(String username) throws BaseException;

	/**
	 * 根据email获取用户信息
	 * 
	 * @param email
	 * @return
	 */
	public Passport getByEmail(String email) throws BaseException;

	/**
	 * 修改密码
	 * 
	 * @param username
	 * @param pwd
	 * @return 主键
	 */
	public boolean updatePwd(String username, String pwd) throws BaseException;

	/**
	 * 更新邮箱
	 * 
	 * @param username
	 * @param email
	 * @return 主键
	 */
	public boolean updateEmail(String username, String email)
			throws BaseException;

	/**
	 * 
	 * @param username
	 * @return
	 */
	public boolean removeByUsername(String username) throws BaseException;

	/**
	 * 
	 * @param limit
	 * @param page
	 * @return
	 */
	public List<Passport> selectList(int page, int pages);

}
